package com.et114.core.exception;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/*
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author guanhw
 * @version 1.0
 */
public class BaseException extends RuntimeException {
	private static final long	serialVersionUID	= 2380927340854608780L;
	private Log					log					= LogFactory.getLog ( getClass ( ) );
	private Throwable			_rootCause;
	
	/**
	 * 
	 */
	public BaseException ( ) {
		super ( );
	}
	
	/**
	 * 
	 * @param message
	 */
	public BaseException ( String message ) {
		super ( message );
	}
	
	/**
	 * @param cause
	 */
	public BaseException ( Throwable cause ) {
		super ( cause );
	}
	
	/**
	 * 
	 * 
	 * @param message
	 * @param cause
	 */
	public BaseException ( String message , Throwable cause ) {
		super ( message );
		if ( cause instanceof BaseException ) {
			_rootCause = ( ( BaseException ) cause )._rootCause;
		} else {
			_rootCause = cause;
		}
		log.error ( message , cause );
	}
	
}